<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/vue.js"></script>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        html,body{
            height: 100%;
            width: 100%;
        }
        .mask{
            width: 100%;
            height: 100%;
            background: black;
            opacity: 0.3;
            position: absolute;
            left: 0;
            top: 0;
        }
        .login{
            width: 300px;
            height: 200px;
            padding: 10px;
            background: white;
            margin:200px auto;

            
        }
        .login p{
            margin: 10px 0;
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="isShow=true">显示模态窗</button>
        <div v-show="isShow" class="mask" @click="isShow=false">
            <div class="login" @click.stop>
                <p>用户名：<input type="text"></p>
                <p>密码:<input type="text"></p>
                <p><input type="button" value="登录"></p>
            </div>
        </div>
    </div>
    <script>
        //模态窗案例
        const vm = new Vue({
            el:"#app",
            data:{
               isShow:false
            },
            methods:{
            }
        })

    </script>
</body>
</html>